package com.jast.business.service.impl;

import java.util.List;
import com.jast.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jast.business.mapper.BigdataRedisKvMapper;
import com.jast.business.domain.BigdataRedisKv;
import com.jast.business.service.IBigdataRedisKvService;
import com.jast.common.core.text.Convert;

/**
 * redis 监控实时指标Service业务层处理
 * 
 * @author Jast
 * @date 2023-01-31
 */
@Service
public class BigdataRedisKvServiceImpl implements IBigdataRedisKvService 
{
    @Autowired
    private BigdataRedisKvMapper bigdataRedisKvMapper;

    /**
     * 查询redis 监控实时指标
     * 
     * @param id redis 监控实时指标主键
     * @return redis 监控实时指标
     */
    @Override
    public BigdataRedisKv selectBigdataRedisKvById(Long id)
    {
        return bigdataRedisKvMapper.selectBigdataRedisKvById(id);
    }

    /**
     * 查询redis 监控实时指标列表
     * 
     * @param bigdataRedisKv redis 监控实时指标
     * @return redis 监控实时指标
     */
    @Override
    public List<BigdataRedisKv> selectBigdataRedisKvList(BigdataRedisKv bigdataRedisKv)
    {
        return bigdataRedisKvMapper.selectBigdataRedisKvList(bigdataRedisKv);
    }

    /**
     * 新增redis 监控实时指标
     * 
     * @param bigdataRedisKv redis 监控实时指标
     * @return 结果
     */
    @Override
    public int insertBigdataRedisKv(BigdataRedisKv bigdataRedisKv)
    {
        bigdataRedisKv.setCreateTime(DateUtils.getNowDate());
        return bigdataRedisKvMapper.insertBigdataRedisKv(bigdataRedisKv);
    }

    /**
     * 修改redis 监控实时指标
     * 
     * @param bigdataRedisKv redis 监控实时指标
     * @return 结果
     */
    @Override
    public int updateBigdataRedisKv(BigdataRedisKv bigdataRedisKv)
    {
        bigdataRedisKv.setUpdateTime(DateUtils.getNowDate());
        return bigdataRedisKvMapper.updateBigdataRedisKv(bigdataRedisKv);
    }

    @Override
    public int updateBigdataRedisKvByKey(BigdataRedisKv bigdataRedisKv) {
        
        bigdataRedisKv.setUpdateTime(DateUtils.getNowDate());
        return bigdataRedisKvMapper.updateBigdataRedisKvByKey(bigdataRedisKv);
    }

    /**
     * 批量删除redis 监控实时指标
     * 
     * @param ids 需要删除的redis 监控实时指标主键
     * @return 结果
     */
    @Override
    public int deleteBigdataRedisKvByIds(String ids)
    {
        return bigdataRedisKvMapper.deleteBigdataRedisKvByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除redis 监控实时指标信息
     * 
     * @param id redis 监控实时指标主键
     * @return 结果
     */
    @Override
    public int deleteBigdataRedisKvById(Long id)
    {
        return bigdataRedisKvMapper.deleteBigdataRedisKvById(id);
    }
}
